package csel.model;

public class HealDamage extends TimedEffect implements java.io.Serializable
{
	private static final long serialVersionUID = 1L;
	int rate;
	int tickCount;

	public HealDamage()
	{
	}

	public HealDamage(int rate)
	{
		tickCount = 0;
		this.rate = rate;
	}

	protected void doEffect(Entity e)
	{
		e.setLifeLeft(e.getLifeLeft() - rate);
		tickCount = 0;
	}

	public void tick()
	{
		if (tickCount >= 50)
		{
			this.doEffect(e);
		}
		tickCount++;
	}
}
